﻿namespace Service.Framework.ApplicationEventBus
{
    public interface IApplicationEventBus : IScopedService
    {

        /// <summary>
        /// 事件发布
        /// </summary>
        void Publish<TEventArgs>(TEventArgs eventArgs) where TEventArgs : IApplicationEventArgs;

        /// <summary>
        /// 异步事件发布
        /// </summary>
        /// <returns></returns>
        Task PublishAsync<TEventArgs>(TEventArgs eventArgs) where TEventArgs : IApplicationEventArgs;
    }
}
